package com.infinitus.nginxInfo.domain;


import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="filter_count_log")
@NamedQueries({@NamedQuery(name="FilterCountLog.findAll", query="SELECT e FROM FilterCountLog e"),
	@NamedQuery(name="FilterCountLog.findByDateAndTopic", query="select e from FilterCountLog e where e.theDate =:theDate and e.receiverTopic=:receiverTopic"),
	@NamedQuery(name="FilterCountLog.findByDate", query="select e from FilterCountLog e where e.theDate =:theDate"),
	@NamedQuery(name="FilterCountLog.findDate", query="select date_format(e.theDate ,'%Y-%m-%d') from FilterCountLog e  order by e.theDate asc"),
	@NamedQuery(name="FilterCountLog.lastTime", query="SELECT e FROM FilterCountLog e WHERE TO_DAYS(e.theDate) =  TO_DAYS(NOW())")})
public class FilterCountLog implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7156240392376469078L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long id;
	
	private Integer totalCount;
	
	private Integer sendCount;
	
	private Integer errorCount;
	
	@Temporal(TemporalType.DATE)
	private Date theDate;
	
	@Temporal(TemporalType.TIMESTAMP)
	private Date addTime;
	
	private String receiverTopic;
	


	public String getReceiverTopic() {
		return receiverTopic;
	}


	public void setReceiverTopic(String receiverTopic) {
		this.receiverTopic = receiverTopic;
	}


	public FilterCountLog() {
		super();
	}


	public FilterCountLog(Integer totalCount, Integer errorCount, Date theDate, Date addTime) {
		super();
		this.totalCount = totalCount;
		this.errorCount = errorCount;
		this.theDate = theDate;
		this.addTime = addTime;
	}

	public FilterCountLog(Integer totalCount, Integer errorCount, Date theDate, Date addTime, String receiverTopic) {
		super();
		this.totalCount = totalCount;
		this.errorCount = errorCount;
		this.theDate = theDate;
		this.addTime = addTime;
		this.receiverTopic = receiverTopic;
	}
	
	public FilterCountLog(Integer totalCount, Integer sendCount, Integer errorCount, Date theDate, Date addTime, String receiverTopic) {
		super();
		this.totalCount = totalCount;
		this.sendCount = sendCount;
		this.errorCount = errorCount;
		this.theDate = theDate;
		this.addTime = addTime;
		this.receiverTopic = receiverTopic;
	}
	




	public long getId() {
		return id;
	}

	
	
	
	public void setId(long id) {
		this.id = id;
	}




	public Integer getTotalCount() {
		return totalCount;
	}





	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}



	public Integer getSendCount() {
		return sendCount;
	}


	public void setSendCount(Integer sendCount) {
		this.sendCount = sendCount;
	}


	public Integer getErrorCount() {
		return errorCount;
	}





	public void setErrorCount(Integer errorCount) {
		this.errorCount = errorCount;
	}





	public Date getTheDate() {
		return theDate;
	}


	public void setTheDate(Date theDate) {
		this.theDate = theDate;
	}


	public Date getAddTime() {
		return addTime;
	}


	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}


}
